home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2335 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.4 KB  |  91 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: news.shlink.de!wiloyee!chaos
  3. From: chaos@wiloyee.shnet.org
  4. Subject: Re: disable datacache to gain speed , was Demo/game to OS friendly part II
  5. X-Newsreader: TIN [version 1.2 PL2]
  6. Organization: Studentenhochhaus Wedel Deutschland
  7. Message-ID: <DLxyF9.oDD@wiloyee.shnet.org>
  8. References: <john.hendrikx.48xr@grafix.xs4all.nl>
  9. Date: Mon, 29 Jan 1996 11:54:45 GMT
  10.  
  11. John Hendrikx (john.hendrikx@grafix.xs4all.nl) wrote:
  12.  
  13. : That's interesting, on my setup however the Movem loop is not the fastest way
  14. : to copy (but that's not the issue).  The most interesting result from my test
  15. : however was that turning off DataCache on my 68030/22 had a dramatic increase
  16. : in copying performance:
  17.  
  18. : Testresults - Mar 21 1995
  19.  
  20. :   Using a Movem-loop 200990 bytes/frame (PAL machine, 12 registers used,
  21. :   unrolled 3 times)
  22. :   (9.58 MB/sec, AIBB tells me 9.5-9.8 MB/sec)
  23.  
  24. :   Using a 48 times unrolled Move.l-loop 212353 bytes/frame
  25. :   (10.1 MB/sec)
  26.  
  27. : Now with datacache off (!):
  28.  
  29. :   Using a 48 times unrolled Move.l-loop 242323 bytes/frame
  30. :   (11.6 MB/sec)
  31.  
  32. : The Movem loop wasn't the most optimized version possible, but I doubt it would
  33. : have made much difference.
  34.  
  35. : (All tests done on a 68030/22 MHz, 60ns 32-bit FastRAM. Source and destination
  36. : were not overlapping.  During tests interrupts and all DMA was disabled)
  37.  
  38. : Can anybody explain what is happening with the DataCaching?  According to my
  39. : tests ChipRAM access also becomes faster with DataCache off.
  40.  
  41.  
  42. i have a similar problem. on my a4000/40 i can increase the speed of all
  43. routines with random memory access by disabling the datacache. with random
  44. memory access i mean things like texture mapping, rotating zoomers, etc.
  45. that work on big textures, on a big memory region, but in a way that makes
  46. caching allomost impossible. 
  47.  
  48. here the solution is simple. the 68040 will ALLWAYS try a burst access,
  49. meaning to read 4 longwords. but in the situation of a texturemapper with
  50. large texture, 3 of them get thrown away. the 68040 does not allow you to
  51. switch of the burst mode, you only can switch of the entire cache. if there
  52. is no burst mode possible (as in the 4000/40), the cpu will read all 4
  53. longword without burst. the result is, that it has to do 4 longword accesses
  54. every time i want to read a single byte.
  55.  
  56. all my demos (yes, i am a kewl c0d3r) contain a routine that is called for
  57. this effects, that checks the cpu and sets 68030 to burst off and 68040 to
  58. cache off (this is an advantage even for real burst systems). well, on 68060
  59. my demos crash...
  60.  
  61. in your situation it might be something different, but you may try to switch
  62. of the burstmode and mesure again.
  63.  
  64. another problem might be that read and write region overlap in the cache. as
  65. far as i knowm the 256 byte cache has for pages, leaving 64 bytes. if source
  66. and destination are about 64 bytes apart, writing may throuw out reading
  67. with a 1 to 4 chance (68040 uses a random generator to select the page). if
  68. you wrote something like this
  69.  
  70. source    ds.b    $10000
  71. dest    ds.b    $10000
  72.  
  73. change it to
  74.  
  75. source    ds.b    $10000
  76.     ds.b    $20
  77. dest    ds.b    $10000
  78.  
  79. if this solves your problem, then you know what it was.
  80.  
  81. on the other hand, using 14 registers @ 4 bytes makes 58 bytes. this is
  82. allomost an entire cache page. to check this out properly, try exaclty 32
  83. bytes on cache page boundary.
  84.  
  85. all this does not lead to a better routine, but to more understanding where
  86. the problem comes from.
  87.  
  88. please mail me for results.
  89.  
  90.  
  91.